import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';

export interface Spec extends TurboModule {
  // Speech Recognition
  startSpeechRecognition(locale?: string): Promise<void>;
  stopSpeechRecognition(): Promise<string>;
  cancelSpeechRecognition(): Promise<void>;
  isSpeechRecognitionAvailable(): Promise<boolean>;
  
  // Text to Speech
  speak(text: string, options?: {
    language?: string;
    pitch?: number;
    rate?: number;
    volume?: number;
  }): Promise<void>;
  stop(): Promise<void>;
  pause(): Promise<void>;
  resume(): Promise<void>;
  isSpeaking(): Promise<boolean>;
  
  // Event listeners
  addListener(eventName: string): void;
  removeListeners(count: number): void;
}

export default TurboModuleRegistry.getEnforcing<Spec>('SpeechEngine');
